syntax enable
set syntax=on
set ts=4
set nu
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set autoindent
set autoread
set smartindent
set showmatch
set ruler
set ignorecase
set incsearch
set hlsearch
set shiftwidth=4
set softtabstop=4
set cmdheight=3
set laststatus=2
set nowrap

"取消自动备份及产生swp文件
set nobackup
set nowb
set noswapfile

"允许使用鼠标点击定位
set mouse=a
set scrolloff=3
colorscheme molokai

autocmd FileType python setlocal et sta ts=4 sw=4 sts=4
autocmd FileType python syn sync minlines=1000
autocmd FileType python set omnifunc=pythoncomplete#Complete

map tn :tabn<CR>
map tp :tabp<CR>
map tc :tabc<CR>
map to :tabo<CR>
map tt :tabnew<CR>


set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'posva/vim-vue'
Plugin 'mattn/emmet-vim'
Plugin 'ternjs/tern_for_vim'
Plugin 'pangloss/vim-javascript'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
call vundle#end()

filetype plugin indent on

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
